/******************************************************************************
 * @File name   :      IUserPermFuncService.java
 *
 * @Author      :      wujianxi
 *
 * @Date        :      2011-6-20
 *
 * @Copyright Notice: 
 * Copyright (c) 2014 DMS, Inc. All  Rights Reserved.
 * This software is published under the terms of the DMS Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * 
 * ----------------------------------------------------------------------------
 * Date                   Who         Version        Comments
 * 2011-6-20 下午06:57:35        wujianxi     1.0            Initial Version
 * 2011-9-28 下午05:30:00        wangzhize     1.1     增加方法 validateDeleteRole，验证角色是否可被删除
 *****************************************************************************/
package com.cap.bts.framework.dm.userperm.service;

import java.util.List;

import com.cap.bts.framework.common.exception.AppException;
import com.cap.bts.framework.common.service.IBaseService;
import com.cap.bts.framework.usermgnt.dto.RoleAndFunctionsDto;

/**
 *
 */
public interface IUserPermFuncService extends IBaseService{
    /**
     * 根据用户ID以及提交的角色ID列表来更新关联的角色关系。需要调用JMS Common Service将关联关系同步到dms系统中。
     * @Date        :      2011-6-21
     * @param userResultDto
     * @throws AppException
     */
    void updateUserAndRoleRelation(long userId, long roleId, int isDefaultRole) throws AppException;
    
    /**
     * 删除用户角色关系表中的数据，按照用户id
     * @Date        :      2011-6-30
     * @param userId
     * @throws AppException
     */
    public void deleteUserAndRoleRelation(long userId) throws AppException;
    
    public void transferWork(long fromUserId, long toUserId, boolean needTransfer)
        throws AppException;
    
    /**
     * create role and function
     * @author ZIZOU WANG
     * @Date        :      2011-9-1
     * @param roleAndFunctionsDto
     * @throws AppException
     */
    void createRolesAndFunctions(RoleAndFunctionsDto roleAndFunctionsDto) throws AppException;
    /**
     * update role and function
     * @author ZIZOU WANG
     * @Date        :      2011-9-1
     * @param roleAndFunctionsDto
     * @throws AppException
     */
    void updateRoleAndFunctions(RoleAndFunctionsDto roleAndFunctionsDto) throws AppException;
    /**
     * physical delete role by id
     * @author ZIZOU WANG
     * @Date        :      2011-9-1
     * @param roleAndFunctionsDto
     * @throws AppException
     */
    public boolean deleteRoleById(Long id) throws AppException;
    
    /**
     * 将新增的人员和角色发送到对应系统
     * @Date        :      2011-9-6
     * @param userId  
     * @param roleList  
     * @throws AppException 
     */
    public void jmsUserAndRole(Long userId, List<String> roleList) throws AppException;
    
    /**
     * 判断角色可否被删除
     * @author ZIZOU WANG
     * @Date        :      2011-9-28
     * @param roleId
     * @return
     * @throws AppException
     */
    public boolean validateDeleteRole(Long roleId) throws AppException;
    /**
     * 新增方法:设置角色
     * @Date        :      2012-6-28
     * @param roleArray
     * @param userId
     * @throws AppException
     */
    public void updateUserAndRoleRelation(String[] roleArray,long userId) throws AppException;
}
